3.710 \(\int \frac {A+B \tan (e+f x)}{a+i a \tan (e+f x)} \, dx\)

Optimal. Leaf size=47 \[ \frac {-B+i A}{2 f (a+i a \tan (e+f x))}+\frac {x (A-i B)}{2 a} \]

[Out]

1/2*(A-I*B)*x/a+1/2*(I*A-B)/f/(a+I*a*tan(f*x+e))

________________________________________________________________________________________

Rubi [A]  time = 0.05, antiderivative size = 47, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 2, integrand size = 26, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.077, Rules used = {3526, 8} \[ \frac {-B+i A}{2 f (a+i a \tan (e+f x))}+\frac {x (A-i B)}{2 a} \]

Antiderivative was successfully verified.

[In]

Int[(A + B*Tan[e + f*x])/(a + I*a*Tan[e + f*x]),x]

[Out]

((A - I*B)*x)/(2*a) + (I*A - B)/(2*f*(a + I*a*Tan[e + f*x]))

Rule 8

Int[a_, x_Symbol] :> Simp[a*x, x] /; FreeQ[a, x]

Rule 3526

Int[((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_)*((c_.) + (d_.)*tan[(e_.) + (f_.)*(x_)]), x_Symbol] :> -Simp[((
b*c - a*d)*(a + b*Tan[e + f*x])^m)/(2*a*f*m), x] + Dist[(b*c + a*d)/(2*a*b), Int[(a + b*Tan[e + f*x])^(m + 1),
 x], x] /; FreeQ[{a, b, c, d, e, f}, x] && NeQ[b*c - a*d, 0] && EqQ[a^2 + b^2, 0] && LtQ[m, 0]

Rubi steps

\begin {align*} \int \frac {A+B \tan (e+f x)}{a+i a \tan (e+f x)} \, dx &=\frac {i A-B}{2 f (a+i a \tan (e+f x))}+\frac {(A-i B) \int 1 \, dx}{2 a}\\ &=\frac {(A-i B) x}{2 a}+\frac {i A-B}{2 f (a+i a \tan (e+f x))}\\ \end {align*}

________________________________________________________________________________________

Mathematica [B]  time = 0.52, size = 102, normalized size = 2.17 \[ \frac {\cos (e+f x) (A+B \tan (e+f x)) ((A (2 f x-i)-2 i B f x+B) \tan (e+f x)-2 i A f x+A+B (-2 f x+i))}{4 a f (\tan (e+f x)-i) (A \cos (e+f x)+B \sin (e+f x))} \]

Antiderivative was successfully verified.

[In]

Integrate[(A + B*Tan[e + f*x])/(a + I*a*Tan[e + f*x]),x]

[Out]

(Cos[e + f*x]*(A + B*Tan[e + f*x])*(A - (2*I)*A*f*x + B*(I - 2*f*x) + (B - (2*I)*B*f*x + A*(-I + 2*f*x))*Tan[e
 + f*x]))/(4*a*f*(A*Cos[e + f*x] + B*Sin[e + f*x])*(-I + Tan[e + f*x]))

________________________________________________________________________________________

fricas [A]  time = 0.54, size = 42, normalized size = 0.89 \[ \frac {{\left (2 \, {\left (A - i \, B\right )} f x e^{\left (2 i \, f x + 2 i \, e\right )} + i \, A - B\right )} e^{\left (-2 i \, f x - 2 i \, e\right )}}{4 \, a f} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((A+B*tan(f*x+e))/(a+I*a*tan(f*x+e)),x, algorithm="fricas")

[Out]

1/4*(2*(A - I*B)*f*x*e^(2*I*f*x + 2*I*e) + I*A - B)*e^(-2*I*f*x - 2*I*e)/(a*f)

________________________________________________________________________________________

giac [B]  time = 0.82, size = 90, normalized size = 1.91 \[ -\frac {\frac {{\left (i \, A + B\right )} \log \left (\tan \left (f x + e\right ) - i\right )}{a} + \frac {{\left (-i \, A - B\right )} \log \left (-i \, \tan \left (f x + e\right ) + 1\right )}{a} + \frac {-i \, A \tan \left (f x + e\right ) - B \tan \left (f x + e\right ) - 3 \, A - i \, B}{a {\left (\tan \left (f x + e\right ) - i\right )}}}{4 \, f} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((A+B*tan(f*x+e))/(a+I*a*tan(f*x+e)),x, algorithm="giac")

[Out]

-1/4*((I*A + B)*log(tan(f*x + e) - I)/a + (-I*A - B)*log(-I*tan(f*x + e) + 1)/a + (-I*A*tan(f*x + e) - B*tan(f
*x + e) - 3*A - I*B)/(a*(tan(f*x + e) - I)))/f

________________________________________________________________________________________

maple [B]  time = 0.22, size = 121, normalized size = 2.57 \[ \frac {B \ln \left (\tan \left (f x +e \right )+i\right )}{4 f a}+\frac {i A \ln \left (\tan \left (f x +e \right )+i\right )}{4 f a}+\frac {A}{2 f a \left (\tan \left (f x +e \right )-i\right )}+\frac {i B}{2 f a \left (\tan \left (f x +e \right )-i\right )}-\frac {i \ln \left (\tan \left (f x +e \right )-i\right ) A}{4 f a}-\frac {\ln \left (\tan \left (f x +e \right )-i\right ) B}{4 f a} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((A+B*tan(f*x+e))/(a+I*a*tan(f*x+e)),x)

[Out]

1/4/f/a*B*ln(tan(f*x+e)+I)+1/4*I/f/a*A*ln(tan(f*x+e)+I)+1/2/f/a/(tan(f*x+e)-I)*A+1/2*I/f/a/(tan(f*x+e)-I)*B-1/
4*I/f/a*ln(tan(f*x+e)-I)*A-1/4/f/a*ln(tan(f*x+e)-I)*B

________________________________________________________________________________________

maxima [F(-2)]  time = 0.00, size = 0, normalized size = 0.00 \[ \text {Exception raised: RuntimeError} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((A+B*tan(f*x+e))/(a+I*a*tan(f*x+e)),x, algorithm="maxima")

[Out]

Exception raised: RuntimeError >> ECL says: Error executing code in Maxima: expt: undefined: 0 to a negative e
xponent.

________________________________________________________________________________________

mupad [B]  time = 8.59, size = 45, normalized size = 0.96 \[ -\frac {x\,\left (B+A\,1{}\mathrm {i}\right )\,1{}\mathrm {i}}{2\,a}+\frac {-\frac {B}{2\,a}+\frac {A\,1{}\mathrm {i}}{2\,a}}{f\,\left (1+\mathrm {tan}\left (e+f\,x\right )\,1{}\mathrm {i}\right )} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((A + B*tan(e + f*x))/(a + a*tan(e + f*x)*1i),x)

[Out]

((A*1i)/(2*a) - B/(2*a))/(f*(tan(e + f*x)*1i + 1)) - (x*(A*1i + B)*1i)/(2*a)

________________________________________________________________________________________

sympy [A]  time = 0.25, size = 90, normalized size = 1.91 \[ \begin {cases} - \frac {\left (- i A + B\right ) e^{- 2 i e} e^{- 2 i f x}}{4 a f} & \text {for}\: 4 a f e^{2 i e} \neq 0 \\x \left (- \frac {A - i B}{2 a} + \frac {\left (A e^{2 i e} + A - i B e^{2 i e} + i B\right ) e^{- 2 i e}}{2 a}\right ) & \text {otherwise} \end {cases} - \frac {x \left (- A + i B\right )}{2 a} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((A+B*tan(f*x+e))/(a+I*a*tan(f*x+e)),x)

[Out]

Piecewise((-(-I*A + B)*exp(-2*I*e)*exp(-2*I*f*x)/(4*a*f), Ne(4*a*f*exp(2*I*e), 0)), (x*(-(A - I*B)/(2*a) + (A*
exp(2*I*e) + A - I*B*exp(2*I*e) + I*B)*exp(-2*I*e)/(2*a)), True)) - x*(-A + I*B)/(2*a)

________________________________________________________________________________________